<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       // 判断字符串”abcoefoxyozzopp”中出现次数最多的字符，并统计其次数。
       function objMethod(str){
           let obj={};
           for(let i = 0 ;i<str.length;i++){
        let char=str.charAt(i);
        if(obj[char]){
              obj[char]++;
        }else{
             obj[char]=1;
        }
           }
       
       console.log(obj);
       let max=0;
       for(let key in obj){
            if(max<obj[key]){
                    max=obj[key];
            }
       }
       for(let key in obj){
           if(max==obj[key]){
               console.log(key+":"+max);
           }
       }
       }


       // console.log("字符串出现最多的字符是："+char+","+"次数为："+num+"次");

  
        
    </script>
</body>
</html>